import { Alarm } from './../domain/alarm';
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';

import { OddCustomers } from '../domain/odd-customers';//异常设备数统计数据
import { OddPrams } from '../domain/odd-prams';//参数异常统计页面数据
import { DevicesList } from '../domain/devices-list';//参数异常统计页面数据-详情

import 'rxjs/add/operator/toPromise';

@Injectable()
export class RunningService {

    constructor(private http: Http) { }

/*     getOddCustomers() {
        return this.http.get('assets/mock-data/odd-customers.json')
            .toPromise()
            .then(res => <OddCustomers[]>res.json().data)
            .then(data => { return data; });
    };
    getOddPrams() {
        return this.http.get('assets/mock-data/odd-prams.json')
            .toPromise()
            .then(res => <OddPrams[]>res.json().data)
            .then(data => { return data; });
    } */
    getDevicesList() {
        return this.http.get('assets/mock-data/device-status-list.json')
            .toPromise()
            .then(res => <DevicesList[]>res.json().data)
            .then(data => { return data; });
    }
    getAlarmList() {
        return this.http.get('assets/mock-data/alarm-list.json')
            .toPromise()
            .then(res => res.json().data)
            .then(data => { return data; });
    }
}